<template>
  <div>
    <mt-header title="常见问题">
      <router-link to="/my" slot="left">
        <mt-button icon="back"></mt-button>
      </router-link>
    </mt-header>
    <template v-for="item in questionList">
      <div @click="jump(item)">
        <mt-cell :title="item.ask" is-link></mt-cell>

      </div>
    </template>


  </div>

</template>

<script>
  export default {
    name: "Question",
    data() {
      return {
        questionList: []


      }
    },
    methods: {
      jump(value) {
        this.$router.push(
          {
            path: "QuestionDetail",
            query: {
              ask: value.ask,
              answer: value.answer
            }
          }
        );
      }
    },
    mounted() {
      //请求网络
      this.$axios.get(this.$apis.question).then(res => {
        console.log(res);
        if (res.data.code === 1) {
          //成功
          this.questionList = res.data.data;

        } else {
          //弹错误提示
          this.$myUtils.bottomToast(res.data.msg)
        }
      })
        .catch(error => {
          this.$myUtils.bottomToast(error)
        })
    }

  }
</script>

<style scoped>
</style>
